package com.holi.hiteacher.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.holi.hiteacher.R;

import java.util.Date;

/**
 * @description:
 * @author: JoshuaWong E-mail:joshuawongchn@gmail.com
 * @date: 2016年12月23日 22:30
 * @version: 1.0
 */
public class StudyQuestInfo implements Parcelable {
    public int portrait;
    public String name;
    public Date date;
    public String content;

    protected StudyQuestInfo(Parcel in) {
        portrait = in.readInt();
        name = in.readString();
        content = in.readString();
    }

    public StudyQuestInfo() {
        portrait = R.drawable.default_portrait;
        name = "神秘人物";
        date = new Date();
        content = "Hello, world!";
    }

    public static final Creator<StudyQuestInfo> CREATOR = new Creator<StudyQuestInfo>() {
        @Override
        public StudyQuestInfo createFromParcel(Parcel in) {
            return new StudyQuestInfo(in);
        }

        @Override
        public StudyQuestInfo[] newArray(int size) {
            return new StudyQuestInfo[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(portrait);
        dest.writeString(name);
        dest.writeString(content);
    }
}
